#ifndef __EOBD_H__
#define __EOBD_H__

#include "includes.h"
#include "vehicle.h"
#include "drivers.h"

typedef struct {
    uint8_t id;
    uint8_t pid;
    uint8_t offset;
    uint8_t size;
    uint8_t support;
} EobdPidMap;

void eobd_init(Vehicle *vehicle);

//eobd control functions
void eobd_control_window(uint8_t state);
void eobd_control_door(uint8_t state);
void eobd_get_rpm(uint16_t *rpm);
//eobd data functions
uint8_t eobd_check_engine_on(void);
void eobd_process_eng_data(EngineDataMap *dataMap);
void eobd_get_fault_code(uint8_t type, FaultCodeItem *item);

//uint8_t eobd_id_to_pid(uint8_t id);
void eobd_check_support(void);

#endif
